//
//  MineRouter.swift
//  LeGou
//
//  Created by lxm on 2022/7/23.
//

import Foundation
class MineRouter {
    // 路由
      static func initialize(navigator: NavigatorProtocol) {
          // 我的
          navigator.register("xm://main/Mine/index") { url, values, context in
              return MineVC()
          }
          
          // 设置
          navigator.register("xm://main/Mine/setting") { url, values, context in
              return SettingVC()
          }
          
          // 我的粉丝
          navigator.register("xm://main/Mine/my_fans") { url, values, context in
              return MyTeamVC()
          }
          
          // 他的粉丝
          navigator.register("xm://main/Mine/other_fans") { url, values, context in
              let vc = OtherFansVC()
              if let context = context {
                  if let id = JSON(context)["id"].int {
                     vc.id = id
                  }
              }
              return vc
          }
          
          // 提现
          navigator.register("xm://main/Mine/withdraw") { url, values, context in
              let vc = WithdrawVC()
              if let context = context {
                  if let type = JSON(context)["type"].int {
                     vc.type = type
                  }
              }
              return vc
          }
          
          // 第三方账户
          navigator.register("xm://main/Mine/third_account") { url, values, context in
              return ThirdAccountVC()
          }
          
          // 第三方账户
          navigator.register("xm://main/Mine/account_detail") { url, values, context in
              let vc = AccountBindDetialVC()
              return vc
          }
          
          // 交易明细
          navigator.register("xm://main/Mine/trade_detail") { url, values, context in
              let vc = TradeDetailIndex()
              if let context = context {
                  if let type = JSON(context)["type"].int {
                     vc.type = type
                  }
              }
              return vc
          }
          
          // 修改手机号第一步
          navigator.register("xm://main/Mine/set/change_phone_one") { url, values, context in
              let vc = ChangePhoneOne()
              if let context = context {
                  if let phone = JSON(context)["phone"].string {
                     vc.phone = phone
                  }
              }
              return vc
          }
          
          // 修改手机号第二步
          navigator.register("xm://main/Mine/set/change_phone_two") { url, values, context in
              let vc = ChangePhoneTwo()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 用户信息
          navigator.register("xm://main/Mine/user_info") { url, values, context in
              let vc = UserInfo()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 微信设置
          navigator.register("xm://main/Mine/set_wx") { url, values, context in
              let vc = WechatSetting()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 实名认证
          navigator.register("xm://main/Mine/real_name") { url, values, context in
              let vc = RealName()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 实名认证信息
          navigator.register("xm://main/Mine/real_name_info") { url, values, context in
              let vc = RealNameInfo()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 活跃度
          navigator.register("xm://main/Mine/activity_num") { url, values, context in
              let vc = ActivityNum()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 活跃度
          navigator.register("xm://main/Mine/old_account") { url, values, context in
              let vc = OldManAccount()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 交易设置
          navigator.register("xm://main/Mine/trade_set") { url, values, context in
              let vc = TradePwdVC()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 商城订单
          navigator.register("xm://main/Mine/mall_order") { url, values, context in
              let vc = Orders()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 其他订单
          navigator.register("xm://main/Mine/other_order") { url, values, context in
              let vc = OtherOrders()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 服务商等级
          navigator.register("xm://main/Mine/user_level") { url, values, context in
              let vc = UserLevel()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          // 邀请好友
          navigator.register("xm://main/Mine/invite") { url, values, context in
              let vc = Invite()
              if let context = context {
//                  if let phone = JSON(context)["phone"].string {
//                     vc.phone = phone
//                  }
              }
              return vc
          }
          
          navigator.register("xm://main/Mine/TransferPage") { url, values, context in
              let vc = TransferPage()
              if let context = context {
                  if let type = JSON(context)["type"].int {
                     vc.type = type
                  }
              }
              return vc
          }
          
          
          
      }
    
    
    
}

